package com.bootdo.lvyou_specialty.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou_specialty.dao.LvyouSpecialtyProductArticleDao;
import com.bootdo.lvyou_specialty.domain.LvyouSpecialtyProductArticle;
import com.bootdo.lvyou_specialty.service.LvyouSpecialtyProductArticleService;



@Service
public class LvyouSpecialtyProductArticleServiceImpl implements LvyouSpecialtyProductArticleService {
	@Autowired
	private LvyouSpecialtyProductArticleDao lvyouSpecialtyProductArticleDao;
	
	@Override
	public LvyouSpecialtyProductArticle get(Long id){
		return lvyouSpecialtyProductArticleDao.get(id);
	}
	
	@Override
	public List<LvyouSpecialtyProductArticle> list(Map<String, Object> map){
		return lvyouSpecialtyProductArticleDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lvyouSpecialtyProductArticleDao.count(map);
	}
	
	@Override
	public int save(LvyouSpecialtyProductArticle lvyouSpecialtyProductArticle){
	
		if(lvyouSpecialtyProductArticle.getId() != null) {
			return lvyouSpecialtyProductArticleDao.update(lvyouSpecialtyProductArticle);
		}else {
			return lvyouSpecialtyProductArticleDao.save(lvyouSpecialtyProductArticle);
		}		
	
		
	}
	
	@Override
	public int update(LvyouSpecialtyProductArticle lvyouSpecialtyProductArticle){
		return lvyouSpecialtyProductArticleDao.update(lvyouSpecialtyProductArticle);
	}
	
	@Override
	public int remove(Long id){
		return lvyouSpecialtyProductArticleDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouSpecialtyProductArticleDao.batchRemove(ids);
	}

	@Override
	public List<LvyouSpecialtyProductArticle> getByTypeId(Map<String, Object> param) {
		return lvyouSpecialtyProductArticleDao.getByTypeId(param);
	}

}
